package com.wangsh.usersCenter.users.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.wangsh.usersCenter.common.pojo.BasePojo;
import com.wangsh.usersCenter.system.pojo.ARegion;

public class AUsers extends BasePojo<AUsers>
{
	private int id;
	private int regionId;
	private String email;
	private String password;
	private String souPass ;
	private String nickName;
	private String trueName;
	private String qq;
	private String phone;
	private String weiXin; 
	private Date birthday;
	private byte education;
	private int loginCount;
	private int failedCount;
	private Date failedTime;
	private String address;
	private String photoPath;
	private byte emailStatus;
	private byte phoneStatus;
	private byte idcardStatus;
	private byte sex;
	private byte usersType ; 
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date lastLoginTime;

	private String statusStr;
	private String sexStr;
	private String emailStatusStr;
	private String phoneStatusStr;
	private String idcardStatusStr;
	private String usersTypeStr ;
	private String educationStr ; 
	/* 用户的token */
	private String tokenStr ; 
	/* 存储所有状态的容器 */
	private Map<String,String> enumsMap = new TreeMap<String, String>();
	
	/**
	 * 关联对象
	 */
	private AUsersExtend usersExtend ; 
	private ARegion region ; 
	
	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		AUsersEnum[] usersEnums = AUsersEnum.values();
		for (int i = 0; i < usersEnums.length; i++)
		{
			AUsersEnum usersEnum = usersEnums[i];
			String key = usersEnum.toString() ; 
			enumsMap.put(key + "-" + usersEnum.getStatus() + "", usersEnum.getName());
		}
		return enumsMap;
	}

	public String getUsersTypeStr()
	{
		AUsersEnum[] values = AUsersEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AUsersEnum usersEnumTemp = values[i];
			/*
			 * toString:变量名 name:枚举的键, getstatus:枚举的值
			 */
			if (usersEnumTemp.toString().startsWith("STATUS"))
			{
				if (usersEnumTemp.getStatus() == this.status)
				{
					this.usersTypeStr = usersEnumTemp.getName();
				}
			}
			// System.out.println(adminsEnumTemp.getName() + "=====>" +
			// adminsEnumTemp.getStatus() + "--->" + adminsEnumTemp);
		}
		return usersTypeStr;
	}
	
	public String getStatusStr()
	{
		AUsersEnum[] values = AUsersEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AUsersEnum usersEnumTemp = values[i];
			/*
			 * toString:变量名 name:枚举的键, getstatus:枚举的值
			 */
			if (usersEnumTemp.toString().startsWith("STATUS"))
			{
				if (usersEnumTemp.getStatus() == this.status)
				{
					this.statusStr = usersEnumTemp.getName();
				}
			}
			// System.out.println(adminsEnumTemp.getName() + "=====>" +
			// adminsEnumTemp.getStatus() + "--->" + adminsEnumTemp);
		}
		return statusStr;
	}

	public String getEmailStatusStr()
	{
		AUsersEnum[] values = AUsersEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AUsersEnum usersEnumTemp = values[i];
			
			if (usersEnumTemp.toString().startsWith("EMAILSTATUS"))
			{
				if (usersEnumTemp.getStatus() == this.emailStatus)
				{
					this.emailStatusStr = usersEnumTemp.getName();
				}
			}
		}
		return emailStatusStr;
	}
	
	public String getEducationStr()
	{
		AUsersEnum[] values = AUsersEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AUsersEnum usersEnumTemp = values[i];
			/*
			 * toString:变量名 name:枚举的键, getstatus:枚举的值
			 */
			if (usersEnumTemp.toString().startsWith("EDU"))
			{
				if (usersEnumTemp.getStatus() == this.education)
				{
					this.educationStr = usersEnumTemp.getName();
				}
			}
			// System.out.println(adminsEnumTemp.getName() + "=====>" +
			// adminsEnumTemp.getStatus() + "--->" + adminsEnumTemp);
		}
		return educationStr;
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public int getRegionId()
	{
		return regionId;
	}

	public void setRegionId(int regionId)
	{
		this.regionId = regionId;
	}

	public String getEmail()
	{
		return email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public String getPassword()
	{
		return password;
	}

	public void setPassword(String password)
	{
		this.password = password;
	}

	public String getTrueName()
	{
		return trueName;
	}

	public void setTrueName(String trueName)
	{
		this.trueName = trueName;
	}

	public String getQq()
	{
		return qq;
	}

	public void setQq(String qq)
	{
		this.qq = qq;
	}

	public String getPhone()
	{
		return phone;
	}

	public void setPhone(String phone)
	{
		this.phone = phone;
	}

	public Date getBirthday()
	{
		return birthday;
	}

	public void setBirthday(Date birthday)
	{
		this.birthday = birthday;
	}

	public int getLoginCount()
	{
		return loginCount;
	}

	public void setLoginCount(int loginCount)
	{
		this.loginCount = loginCount;
	}

	public int getFailedCount()
	{
		return failedCount;
	}

	public void setFailedCount(int failedCount)
	{
		this.failedCount = failedCount;
	}

	public Date getFailedTime()
	{
		return failedTime;
	}

	public void setFailedTime(Date failedTime)
	{
		this.failedTime = failedTime;
	}

	public String getAddress()
	{
		return address;
	}

	public void setAddress(String address)
	{
		this.address = address;
	}

	public String getPhotoPath()
	{
		return photoPath;
	}

	public void setPhotoPath(String photoPath)
	{
		this.photoPath = photoPath;
	}

	public byte getIdcardStatus()
	{
		return idcardStatus;
	}

	public void setIdcardStatus(byte idcardStatus)
	{
		this.idcardStatus = idcardStatus;
	}

	public byte getSex()
	{
		return sex;
	}

	public void setSex(byte sex)
	{
		this.sex = sex;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getLastLoginTime()
	{
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime)
	{
		this.lastLoginTime = lastLoginTime;
	}

	@Override
	public String toString()
	{
		return "AUsers [id=" + id + ", regionId=" + regionId + ", email=" + email + ", password=" + password
				+ ", nickName=" + nickName + ", trueName=" + trueName + ", qq=" + qq + ", phone=" + phone
				+ ", birthday=" + birthday + ", loginCount=" + loginCount + ", failedCount=" + failedCount
				+ ", failedTime=" + failedTime + ", address=" + address + ", photoPath=" + photoPath + ", emailStatus="
				+ emailStatus + ", photoStatus=" + phoneStatus + ", idcardStatus=" + idcardStatus + ", sex=" + sex
				+ ", status=" + status + ", createTime=" + createTime + ", updateTime=" + updateTime
				+ ", lastLoginTime=" + lastLoginTime + "]";
	}
	
	public String getSexStr()
	{
		AUsersEnum[] values = AUsersEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AUsersEnum usersEnumTemp = values[i];
			/*
			 * toString:变量名 name:枚举的键, getstatus:枚举的值
			 */
			if (usersEnumTemp.toString().startsWith("SEX"))
			{
				if (usersEnumTemp.getStatus() == this.sex)
				{
					this.sexStr = usersEnumTemp.getName();
				}
			}
			// System.out.println(adminsEnumTemp.getName() + "=====>" +
			// adminsEnumTemp.getStatus() + "--->" + adminsEnumTemp);
		}
		return sexStr;
	}

	public String getNickName()
	{
		return nickName;
	}

	public void setNickName(String nickName)
	{
		this.nickName = nickName;
	}

	public byte getEmailStatus()
	{
		return emailStatus;
	}

	public void setEmailStatus(byte emailStatus)
	{
		this.emailStatus = emailStatus;
	}

	public byte getPhoneStatus()
	{
		return phoneStatus;
	}

	public void setPhoneStatus(byte phoneStatus)
	{
		this.phoneStatus = phoneStatus;
	}

	public String getIdcardStatusStr()
	{
		AUsersEnum[] values = AUsersEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AUsersEnum usersEnumTemp = values[i];
			/*
			 * toString:变量名 name:枚举的键, getstatus:枚举的值
			 */
			if (usersEnumTemp.toString().startsWith("IDCARDSTATUS"))
			{
				if (usersEnumTemp.getStatus() == this.idcardStatus)
				{
					this.idcardStatusStr = usersEnumTemp.getName();
				}
			}
			// System.out.println(adminsEnumTemp.getName() + "=====>" +
			// adminsEnumTemp.getStatus() + "--->" + adminsEnumTemp);
		}
		return idcardStatusStr;
	}
	
	public String getPhoneStatusStr()
	{
		AUsersEnum[] values = AUsersEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AUsersEnum usersEnumTemp = values[i];
			/*
			 * toString:变量名 name:枚举的键, getstatus:枚举的值
			 */
			if (usersEnumTemp.toString().startsWith("PHONESTATUS"))
			{
				if (usersEnumTemp.getStatus() == this.phoneStatus)
				{
					this.phoneStatusStr = usersEnumTemp.getName();
				}
			}
			// System.out.println(adminsEnumTemp.getName() + "=====>" +
			// adminsEnumTemp.getStatus() + "--->" + adminsEnumTemp);
		}
		return phoneStatusStr;
	}

	public AUsersExtend getUsersExtend()
	{
		return usersExtend;
	}

	public void setUsersExtend(AUsersExtend usersExtend)
	{
		this.usersExtend = usersExtend;
	}

	public byte getUsersType()
	{
		return usersType;
	}

	public void setUsersType(byte usersType)
	{
		this.usersType = usersType;
	}

	public String getTokenStr()
	{
		return tokenStr;
	}

	public void setTokenStr(String tokenStr)
	{
		this.tokenStr = tokenStr;
	}

	public ARegion getRegion()
	{
		return region;
	}

	public void setRegion(ARegion region)
	{
		this.region = region;
	}

	public String getWeiXin()
	{
		return weiXin;
	}

	public void setWeiXin(String weiXin)
	{
		this.weiXin = weiXin;
	}

	public byte getEducation()
	{
		return education;
	}

	public void setEducation(byte education)
	{
		this.education = education;
	}

	public String getSouPass()
	{
		return souPass;
	}

	public void setSouPass(String souPass)
	{
		this.souPass = souPass;
	}
	
}
